import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import {tap } from 'rxjs/operators';
import { environment } from '../../../environments/environment';

const httpOptions = {
  headers: new HttpHeaders({
    'Content-Type':  'application/json'
  })
};

@Injectable({
  providedIn: 'root'
})
export class HttpService {
  private url = 'http://localhost:8899/cras/';
  constructor(
    private http: HttpClient
  ) { }

  sendRequest(send){
    let api = this.url + send.url
    return this.http.post(api, send.data, httpOptions)
    .pipe(
      tap( // 
        
      )
    );
  }
}
